Skip to content

Revert 5412 url reader special chars#5785

Closed
ales-erjavec wants to merge 2 commits intobiolab:masterfrom
ales-erjavec:revert-5412-url_reader_special_chars
Closed

Revert 5412 url reader special chars#5785
ales-erjavec wants to merge 2 commits intobiolab:masterfrom
ales-erjavec:revert-5412-url_reader_special_chars

Conversation

@ales-erjavec
Copy link
Contributor

Issue

Fixes #5723

Description of changes
Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #5785 (116d392) into master (2e2ca17) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5785      +/-   ##
==========================================
- Coverage   86.12%   86.12%   -0.01%     
==========================================
  Files         316      316              
  Lines       66400    66384      -16     
==========================================
- Hits        57189    57174      -15     
+ Misses       9211     9210       -1     

# tolerant parse, also prevent parsing as local file
parsed = QUrl.fromUserInput(url, os.devnull)
if parsed.isValid():
url = bytes(parsed.toEncoded()).decode("ascii")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem of this solution is, that the UrlReader itself still doesn't work, so the change would have to be made in every widget that uses it.

I'd rather the fix was made within the UrlReader.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. UrlReader should not accept invalid urls and should not do anything that could break valid urls.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but valid at which level? Shouldn't we support URLs as a browser would? If there is some non-destructive encoding/decoding happening in the background, why not put it into UrlReader?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine.

@ales-erjavec ales-erjavec force-pushed the revert-5412-url_reader_special_chars branch from 476e645 to 97d6057 Compare January 14, 2022 10:54
@ales-erjavec ales-erjavec force-pushed the revert-5412-url_reader_special_chars branch from 97d6057 to 116d392 Compare January 14, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File can not read Google Sheets

3 participants